using System.Collections.Generic;
using System.IO;

using lucere.index.write;

namespace lucere.index.inversion
{
    public interface IInvertedDocumentEndConsumer 
    {

        IInvertedDocumentEndConsumerPerThread AddThread(IDocumentInverterPerThread docInverterPerThread);

        /// <summary>
        /// </summary>
        /// <param name="threadsAndFields"></param>
        /// <param name="state"></param>
        /// <exception cref="IOException"></exception>
        void Flush(IDictionary<IInvertedDocumentEndConsumerPerThread, IList<IInvertedDocumentEndConsumerPerField>> threadsAndFields, ISegmentWriteState state);
        
        /// <summary>
        /// </summary>
        /// <param name="state"></param>
        /// <exception cref="IOException"></exception>
        void CloseDocStore(ISegmentWriteState state);

        void Abort();

        void SetFieldInfos(IFieldInfos fieldInfos);
    }
}